<?php

use fztadmin\modules\platform\models\forms\LogPlatformCapitalOperation;
use kartik\form\ActiveForm;
use yii\bootstrap\Html;
use wodrow\yii2wtools\tools\JsBlock;
use yii\helpers\Url;
use common\Tools;
use kartik\select2\Select2;
use yii\web\JsExpression;
/**
 * @var \yii\web\View $this
 * @var $model LogPlatformCapitalOperation
 */
$this->title = "平台分户转会员分户";
?>

    <div>
        <div class="row">
            <div class="col-xs-12">
                <?php $form = ActiveForm::begin(); ?>
                <?=$form->field($model, 'trans_id')->hiddenInput(['value' => uniqid()])->label(false) ?>
                <div class="row">
                    <div class="col-xs-4">
                        <?=$form->field($model, 'acct_type')->dropDownList($model->getAcctTypeDesc()) ?>
                    </div>
                    <div class="clearfix"></div>
                    <div class="col-xs-4">
                        <?=$form->field($model, 'plat_cust_no')->widget(Select2::class, [
                            'options' => ['placeholder' => '你可以查询后选择'],
                        'pluginOptions' => [
                            'placeholder' => '查询',
                            'allowClear' => true,
                            'ajax' => [
                                'url' => Url::to(['/ajax/cust/get-custom-no-sel']),
                                'dataType' => 'json',
                                'data' => new JsExpression('function(params) { return {q:params.term}; }')
                            ],
                            'escapeMarkup' => new JsExpression('function (markup) { return markup; }'),
                            'templateResult' => new JsExpression('function(res) { return res.text; }'),
                            'templateSelection' => new JsExpression('function (res) { return res.text; }'),
                        ],
                        'pluginEvents' => [
                            'change' => 'function() { noauthCourierExclusivePackagePlaceOrder.toCountyId = $(this).val(); }'
                        ],
                        ]) ?>
                    </div>
                    <div class="clearfix"></div>
                    <div class="col-xs-2">
                        <?=$form->field($model, 'trans_amount')->textInput() ?>
                    </div>
                    <div class="clearfix"></div>
                    <div class="col-xs-6">
                        <?=$form->field($model, 'remark')->textarea() ?>
                    </div>
                    <div class="clearfix"></div>
                </div>
                <?=Html::submitButton("确认", ['class' => "btn btn-primary"]); ?>
                <?php ActiveForm::end(); ?>
            </div>
            </div>
        </div>
    </div>

<?php JsBlock::begin(); ?>
    <script>
        $(function (){});
    </script>
<?php JsBlock::end(); ?>